<?php
session_start();
require('config.php');
$link = mysql_connect($config['mysql_host'], $config['mysql_username'], $config['mysql_password']);
mysql_select_db($config['mysql_database']);

$computer_id = 'abc123';

echo '<h1>Logs</h1><br />';
$result = mysql_query('select * from logs where computer_id="'.$computer_id.'"');
while($row = mysql_fetch_assoc($result))
{
	echo 'Ping from <strong>'.$row['log_ip'].'</strong> at <strong>'.date('g:i:s a', $row['log_date']).'</strong> on <strong>'.date('n/j/Y', $row['log_date']).'</strong><br />';
}

echo '<h1>Screenshots</h1><br />';
$result = mysql_query('select * from images where computer_id="'.$computer_id.'" and image_type="0"');
while($row = mysql_fetch_assoc($result))
{
	echo 'Recieved at <strong>'.date('g:i:s a', $row['image_date']).'</strong> on <strong>'.date('n/j/Y', $row['image_date']).'</strong><br />';
	echo '<img src="image.php?image='.$row['image_id'].'" /><br />';
}

echo '<h1>iSight Pictures</h1><br />';
$result = mysql_query('select * from images where computer_id="'.$computer_id.'" and image_type="1"');
while($row = mysql_fetch_assoc($result))
{
	echo 'Recieved at <strong>'.date('g:i:s a', $row['image_date']).'</strong> on <strong>'.date('n/j/Y', $row['image_date']).'</strong><br />';
	echo '<img src="image.php?image='.$row['image_id'].'" /><br />';
}
?>